import {goodsInfoList} from '@/apis/goodsInfo/index'
import {ref,reactive,onMounted} from 'vue'
import {useRoute} from 'vue-router'
export const useGoodsInfo = () => {
    let goodsInfo = reactive({})
    let route = useRoute()
    onMounted(()=>{
        getGoodsInfo()
    })
    const getGoodsInfo = async () => {
        let res = await goodsInfoList(route.params.id)
        Object.assign(goodsInfo,res.result)
    }
    return {
        goodsInfo
    }
}